#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
int  diguidayin(int n)
{
	int a = n % 10;
	if (n < 10)
	{
		printf("%d ", a);
		return 0;
	}
	else
	{
		
		diguidayin(n / 10);
		printf("%d ", a);
		return 0;
	}
}
int main()
{
	int n = 0;

	while (scanf("%d", &n) == 1)
	{
		diguidayin(n);
		printf("\n");
	}
	return 0;
}